package com;

import com.domain.Users;
import com.itheima.util.MyBatisUtils;
import com.mapper.UserMapper;
import com.pojo.User;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;


public class UsersTest {
  @Test
    public void findUserTest(){
      SqlSession sqlSession = MyBatisUtils.getSession();
      Users users = sqlSession.selectOne("com.mapper.UsersMapper.findUserWithOrders", 1);
      System.out.println(users);
      sqlSession.close();
  }
  @Test
  public void selectUserByIdTest(){
    SqlSession session = MyBatisUtils.getSession();
    UserMapper mapper = session.getMapper(UserMapper.class);
    User users = mapper.selectUserById(1);
    System.out.println(users);
    session.close();
  }
}
